package db

import (
	"time"

	"gorm.io/driver/sqlite"
	"gorm.io/gorm"
)

func OpenDB(path string) (*gorm.DB, error) {
	database, err := gorm.Open(sqlite.Open(path), &gorm.Config{
		NowFunc: func() time.Time {
			return time.Now().UTC()
		},
	})
	if err != nil {
		return nil, err
	}

	return database, nil
}
